﻿using JetBrains.Annotations;
using Missbot.AIModule.OnlineStore;
using Missbot.Common;
using Missbot.Core.Base;

namespace Missbot.AIModule.Vip.VipArmers
{
    [UsedImplicitly]
    public class 贤者之石 : IVipArmer
    {
        public string Name { get; set; } = "贤者之石";
        public string Description { get; set; } = "使用钻石兑换1w金币，每周限购一次。";
        public int DiamondsNeed { get; set; } = 400;
        public VipArmerLimitInterval LimitInterval { get; set; } = VipArmerLimitInterval.Weekly;
        public int LimitCount { get; set; } = 1;

        public bool Purchase(InboxSession session)
        {
            var osPerson = OSPersonDA.GetPerson(session.User.ID);
            osPerson.Golds += 10000;
            osPerson.Update();

            session.SendBack($"兑换成功，你当前持有的金币为：{osPerson.Golds.CurencyFormat()}");
            return true;
        }

        public int MaxContains { get; set; }
    }
}